<template>
	<view class="warp ">
		<view class="left">
			<view class="month flex" v-for="(item,index) in month" :key="index">
				<view :class="active == index ?'item-m':'item-s'" @click="actives(index,item)">
					{{item.name}}
				</view>
				<view :class="active == index ?'ball1':'ball'"></view>
			</view>
		</view>
		<view class="right">
			<!-- <view class="flex s-title mt30" style="color: #FFFFFF;"> -->
			<image style="width: 100%;height: 100%;" :src="url" mode="aspectFill"></image>
			</view>
		</view>
	</view>
</template>

<script>
	import {curriculum} from "../../../api/api.js"
	export default {
		data() {
			return {
				month: [
					{name:"一月",prop:"month1"},
					{name:"二月",prop:"month2"},
					{name:"三月",prop:"month3"},
					{name:"四月",prop:"month4"},
					{name:"五月",prop:"month5"},
					{name:"六月",prop:"month6"},
					{name:"七月",prop:"month7"},
					{name:"八月",prop:"month8"},
					{name:"九月",prop:"month9"},
					{name:"十月",prop:"month10"},
					{name:"十一月",prop:"month11"},
					{name:"十二月",prop:"month12"},
					],
					url:"",
					classList:{},
				active:0,
				info:"一月",
			}
		},
		onLoad() {
			let sign = this.$util()
			curriculum(sign).then(res => {
				this.classList = res.data
				this.url = this.classList.month1
			})
		},
		methods:{
			actives(e,a){
				let u = a.prop
				// console.log(this.classList.month2)
				this.url = this.classList[u]
				// console.log('222',e,a,this.url )
				this.active =e
			}
		}
	}
</script>

<style scoped lang="less">
	.warp {
		background-color: #F5F5F5;
		position: fixed;
		display: flex;
		justify-content: flex-start;
		align-items: center;
		width: 100%;

		.left {
			width: 30%;
			background-color: #F5F5F5;
			height: 100%;
		}

		.right {
			width: 70%;
			background-color: rgb(48,200,255);
			height: 100%;
		}
	}

	.month {
		padding: 20rpx;
		.item-m {
			width: 90rpx;
			height: 50rpx;
			line-height: 50rpx;
			text-align: center;
			color: #FFFFFF;
			border-radius: 8rpx;
			background-color: #527DFF;
			margin-top: 30rpx;
		}
		.item-s {
			width: 90rpx;
			height: 50rpx;
			line-height: 50rpx;
			text-align: center;
			color: #000;
			border-radius: 8rpx;
			background-color: #F5F5F5;
			margin-top: 30rpx;
		}
		.ball{
			margin-top: 20rpx;
			width: 30rpx;
			height: 30rpx;
			margin-left: 30rpx;
			border: 2rpx solid  #E5E5E5;
			border-radius: 50%;
			// color: rgb(229,229,229);
		}
		.ball1{
			margin-top: 20rpx;
			width: 30rpx;
			margin-left: 30rpx;
			height: 30rpx;
			border: 2rpx solid #527DFF;
			border-radius: 50%;
			// color: rgb(229,229,229);
		}
	}
</style>
